home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8401 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: newsroom.hitc.com!usenet
  2. From: psand@eos.hitc.com (G. Patrick Sand)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Tough FACTORIAL math problem...
  5. Date: 17 Feb 1996 20:20:09 GMT
  6. Organization: Hughes Aircraft (EOSDIS)
  7. Message-ID: <4g5d9p$f2n@newsroom.hitc.com>
  8. References: <4fr8be$ass@news.iconn.net> <31224679.6193@born.com> <4g00u6$gkk@sun001.spd.dsccc.com> <DMvKp5.2wL@undergrad.math.uwaterloo.ca> <4g2fdq$ibo@beach.and.nl>
  9. NNTP-Posting-Host: 155.157.118.56
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.3
  12.  
  13.  
  14. >Ok, party on ...
  15. >
  16. >         7! =  7x6!  ~ 7x2 = 14 ~ 4
  17. >         8! =  8x7!  ~ 8x4 = 32 ~ 2
  18. >         9! =  9x8!  ~ 9x2 = 18 ~ 8
  19. >        10! = 10x9!  ~10x8 = 80 ~ 8
  20. >        11! = 11x10! ~11x8 = 88 ~ 8
  21. >        12! = 12x11! ~12x8 = 96 ~ 6
  22. >        13! = 13x12! ~13x6 = 78 ~ 8
  23. >        14! = 14x13! ~14x8 =112 ~ 2
  24. >        15! = 15x14! ~15x2 = 30 ~ 3
  25. >
  26. >erm ... 15! happens to be equal to 130764368000 ...
  27. >                                           ^
  28. >                                           |
  29. >                                           |
  30. >                                      See? see? see?
  31. >
  32. >This technique does give the correct result up 'till a certain number ;-
  33. >)
  34. >
  35. >Jos aka jos@and.nl (the middle initial 'A' stands for 'silly')
  36. >
  37. >ps. No hard feelings, I fell into this trap open eyed yesterday
  38. >    and I still feel silly to the core ... ;-)
  39. >-- 
  40. >Atnwgqkrl gy zit vgksr, ug qshiqwtzoeqs!
  41. >
  42.  
  43. Yikes!!!  Looks like I also forgot about "carry numbers"...I wonder if I 
  44. used a 99x99 matrix instead of a 9x9...Nah...But he does bring up the 
  45. fact that this problem has to deal with more than the least significant 
  46. non-zero digit of the factorial value when computing the next one...I 
  47. guess three digits will work for values up to 1,000....Gut feeling is 
  48. that for factorials up through 10**N, you will need to keep the least 
  49. significant N digits for the factorials up to that point...I might try 
  50. this out at home...
  51.  
  52. Nice job Jos...I pretty sure I need a vacation now, if I missed this 
  53. one...
  54.  
  55. Let's see... 1 and 1 is 2, 2 and 2 is four, .... and 15 * 12 is 180, not 
  56. something ending in 30...
  57.  
  58. -- 
  59. G. Patrick Sand
  60. psand@eos.hitc.com
  61. PatSand@aol.com
  62. (301) 925-0791
  63. "Travel Light But Right..."
  64. Microsoft Network is prohibited from redistributing 
  65. this work in any form, in whole or in part.   License 
  66. to distribute this individual post is available to Microsoft
  67. for $999. Posting without permission constitutes an 
  68. agreement to these terms...gps
  69.  
  70.